package com.Ajava1704.for并发包下的类.ForSemphor;

import java.util.concurrent.Semaphore;

/**
 * @类名: com.Ajava1704.for并发包下的类.ForSemphor
 * @作者: lgt
 * @创建时间: 2020-02-11 20:56
 * @描述:
 **/
public class ForTestSemphor {
    public static void main(String[] args) {
        Semaphore semaphore=new Semaphore(1);

        Thread thread=new Thread(new ForSemphRunable(semaphore,1),"A");
        thread.start();

        Thread thread3=new Thread(new ForSemphRunable(semaphore,2),"B");
        thread3.start();

        Thread thread4=new Thread(new ForSemphRunable(semaphore,3),"C");
        thread4.start();

        Thread thread5=new Thread(new ForSemphRunable(semaphore,2),"D");
        thread5.start();

        Thread thread2=new Thread(new ForSemphRunable(semaphore,1),"E");
        thread2.start();

    }
}
